package psd.model.Prolog.Converters;

import org.eclipse.jdt.core.dom.PrefixExpression;

import psd.model.IConverter;
import psd.model.Prolog.FactGenerationToolbox;
import psd.model.Prolog.PrologConverter;


public class PrologPrefixExpressionConverter extends PrologConverter implements
		IConverter<PrefixExpression> {

	public PrologPrefixExpressionConverter(FactGenerationToolbox toolbox) {
		super(toolbox);
	}

	@Override
	public boolean convert(PrefixExpression node) {
		String args[] = {
				(new StringBuilder("[")).append(
						idResolver.getID(node.getOperand())).append("]")
						.toString(),
				(new StringBuilder("'")).append(node.getOperator().toString())
						.append("'").toString(), "-1" };
		createBodyFact(node, "operationT", args);
		return true;
	}

}
